<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<jsp:useBean id="mySqlBean" scope="page" class="com.sims.MySQLConnBean" />
<%@ page import="java.sql.*"%>
<%
	String userAccount = (String) request.getParameter("userAccount");
	String userPassword = (String) request.getParameter("userPassword");
	String userName = (String) request.getParameter("userName");
	int effectrow = 0;
	if (userAccount != null || userAccount.trim().length() > 0) {
		mySqlBean.OpenConn(); //调用MySqlBean中加载JDBC驱动的方法
		
		String strSql = String.format("insert into stn_user(user_account,user_password,user_name) values('%s','%s','%s')",userAccount,userPassword,userName);
	    effectrow = mySqlBean.executeSql(strSql);
		
		mySqlBean.closeStmt();
		mySqlBean.closeConn();
	}
	if (effectrow>0) {
		//成功跳转到列表页面 accountlist.jsp
%>
<jsp:forward page="welcome.jsp" />
<%
	} else {
		//失败跳转到error.jsp
%>
<jsp:forward page="error.jsp" />
<%
	}
%>
